<?
require_once(dirname(dirname(dirname(__FILE__))) . "/_includes/config.php");
require_once(dirname(dirname(dirname(__FILE__))) . "/_includes/classes/paginacao.class.php");

?>

<h2>1 | Selecione o Bonus</h2>
<?
$sql = "SELECT a.nm_cliente, b.dt_bonus, b.vl_qtd_bonus,b.dt_validade_bonus FROM cliente_bonus b, cliente a 
	WHERE a.cd_cliente = b.cd_cliente and b.cd_cliente = '".$cd_cliente."' ORDER BY dt_bonus";
$pg = new paginacao($sql);
$pg->consulta;

$pg->cabecalho = '
  <tr class="linhaHeader">
    <td width="300">Nome</td>
    <td>Data do Bonus</td>
    <td>Data da Validade</td>	
    <td align="right">Bonus</td>		
  </tr>
  ';

$pg->linha = '
  <tr class="linha<?=$c&1?>" onMouseOver="this.className=\'linhaOver\'; this.style.cursor=\'pointer\'" onMouseOut="this.className=\'linha<?=$c++&1?>\'" onClick="window.location.href=\'?dt_bonus=<?=$lst[\'dt_bonus\']. "&" . $_SERVER[\'QUERY_STRING\']?>\'">
    <td><?=$lst[\'nm_cliente\']?></td>
	<td><?=func_bd2data($lst[\'dt_bonus\'])?></td>
	<td><?=func_bd2data($lst[\'dt_validade_bonus\'])?></td>
	<td align="right"><?=$lst[\'vl_qtd_bonus\']?></td>
  </tr>
  ';

$pg->resultado(); 
	
?>
<p align="right">
<input name="formButtonVoltar" type="button" class="formButton" id="formButtonVoltar" value="Voltar" onClick="window.location.href='?cd=<?=func_get_cd_menu("cliente", "alt_bonus")?>'">
</p>